package com.lyl.myaiagent.agent;

import com.lyl.myaiagent.advisor.MySimpleLoggerAdvisor;
import com.lyl.myaiagent.prompt.AgentPrompt;
import com.lyl.myaiagent.servertools.tools.registration.ToolRegistration;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.stereotype.Component;

/**
 * @author lyl
 * @version 1.0
 * @CreateTime: 2025-08-20
 */
@Component
public class Manus extends ToolCallsAgent {

    public Manus(ToolRegistration toolRegistration, ToolCallbackProvider toolCallbackProvider, ChatModel dashscopeChatModel) {
        super(toolRegistration.toolCallbacks(), toolCallbackProvider);

        this.setName("Manus");
        this.setSystemPrompt(AgentPrompt.SYSTEM_PROMPT);
        this.setNextStepPrompt(AgentPrompt.NEXT_STEP_PROMPT);

        this.setMaxSteps(15);

        ChatClient chatClient = ChatClient.builder(dashscopeChatModel)
                .defaultAdvisors(new MySimpleLoggerAdvisor())
                .build();
        setClient(chatClient);
    }
}
